home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
gnustuff
/
minix
/
libsrc~1.z
/
libsrc~1
/
fungetc.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-12-28
|
381 b
|
18 lines
/* from dlibs */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int fungetc(c, fp)
int c;
register FILE *fp;
{
if((fp->_flag & (_IOERR | _IOEOF)) /* error or eof */
|| (fp->_ptr <= fp->_base) /* or too many ungets */
|| (c < 0)) /* or trying to unget EOF */
return(EOF);
++(fp->_cnt);
return(*--(fp->_ptr) = c);
}